import Menu1 from '../menu/index';
import { connect } from 'dva';
import { useState, useEffect } from 'react';
function Employee({
  match: {
    params: { id },
  },
  employee,
  dispatch,
}) {
  useEffect(() => {
    dispatch({
      type: 'employee/getUserInfo',
      id: id,
    });
  }, [employee]);

  // function getUserInfo() {
  // alert(id);
  // dispatch({
  //   type: 'employee/getUserInfo',
  //   id: id,
  // });
  // }

  return (
    <div>
      <Menu1 />
      <div>
        <ul>{id}</ul>

        <div>
          {employee.map((e) => (
            <ul>{e.name}</ul>
          ))}
        </div>

        {/* <ul>{employee.id}</ul>
        <ul>｛employee.name｝</ul> */}
      </div>
    </div>
  );
}
export default connect(({ employee }) => ({ employee }))(Employee);
